package com.example.mapper;

import com.example.pojo.DTO.UpdateGoodDTO;
import com.example.pojo.VO.GoodsDataVO;
import com.example.pojo.entrity.product;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ProductMapper {


     void addGood(product pd);

     @Select("select * from product group by category")
     List<GoodsDataVO> getGoods();

     @Delete("delete * from product where product_id in #({list})")
     void deleteProducts(List<Integer> list);
     @Select("select * from product where name like CONCAT('%', #{name}, '%')")
     List<GoodsDataVO> selectGoods(String name);

     void updateGood(UpdateGoodDTO goodDTO);
     @Select("select * from product where product_id = #{id}")
     product getData(String id);
}
